package Collection.Iterator;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.function.Consumer;

public class Test {
    public static void main(String[] args) {
        //创建集合
        Collection<String> list = new ArrayList<>();
        list.add("玩偶姐姐");
        list.add("吴老师");
        list.add("刘玥老师");

        Iterator<String> it = list.iterator();
        while (it.hasNext()) {
            String name = it.next();
            System.out.println(name);
            System.out.println("===========");
            for (String name1 : list){
                System.out.println(name1);
            }
            list.forEach( s ->System.out.println(s));
        }
    }
}
